package pl.edu.romanow.model

import com.tinkerpop.gremlin.scala.GremlinScalaPipeline
import com.tinkerpop.blueprints.pgm.impls.neo4j.Neo4jGraph
import net.liftweb.common.Loggable
import com.tinkerpop.blueprints.pgm.TransactionalGraph.Conclusion
import java.util.concurrent.TimeUnit
import com.tinkerpop.blueprints.pgm.{Edge, Vertex}

/**
 * Created by IntelliJ IDEA.
 * User: jar
 * Date: 03.04.12
 * Time: 20:38
 * To change this template use File | Settings | File Templates.
 */

object Database extends Loggable {


  var iName = "local:sgvd"
  var iUser = "admin"
  var iPassword = "admin"


  def init(iName: String, iUser: String, iPass: String) = {
    this.iName = iName;
    this.iPassword = iPass;
    this.iUser = iUser;
  }

  private def document() = {
    new Neo4jGraph("my_database")
  }


  def G(v: Vertex) = new GremlinScalaPipeline().start(v)

  def G(v: Edge) = new GremlinScalaPipeline().start(v)


  val appCon = ConnectionManager(document())

}